Technical Q&AQD3D 84 - Checking For QD3D Windows DLLs (11-July-97)Q Is there any QuickDraw 3D Gestalt equivalent on the Windows side which will tell you if QD3D
is present?A There is no exact equivalent to Gestalt on Windows. It's not really necessary because the
entire system is just based on shared libraries (DLLs). The simplest way to check for the presence of QD3D is to try and load the QD3D library.
#if defined (DEBUG) hinst = LoadLibrary( "QD3D_D.DLL" ); #else hinst = LoadLibrary( "QD3D.DLL" ); #endif if ( hinst != NULL ) { Q3GetVersion( &major, &minor ); // Use it... } else { // QuickDraw 3D not present // handle that... } Additionally the QD3D DLLs all have version resources which can be queried using the Win32 version control API without loading the library. The QD3D installer registers several keys in the registry which could also be used to determine if QD3D was installed. Note: Apple requires that Independent Software Vendors install QD3D using the QD3D installer or its equivalent. Just copying the DLLs is not sufficient. These include HKLM\SOFTWARE\Apple Computer Inc\QuickDraw 3D\... Note there is no equivalent to "weak linking" on Windows. An application which links against QD3D will fail to load
if QD3D is not present. An application which is concerned that QD3D might not be present will have to dynamically load and link against QD3D
using the QD3D should have only a minimal impact on working set if it is not fully initialized (via Q3Initialize) or used. Note the QD3D Viewer can be used without explicit linking against the 3DViewer.DLL. See the Windows SDK sample "ViewerSampleWin32Only." -- Scott Kuechle Worldwide Developer Technical Support Technical Q&A Previous Question | Contents | Next Question To contact us, please use the Contact Us page. |